<!doctype html>
<html lang="en">
<head>
    <?php include "../include/header.php"; ?>
    <?php include "../include/conn.php"; ?>
</head>
<body>
<?php
$id = $_GET['id'];
$result = mysql_query("SELECT * FROM blog where id =" . $id);

if (!$result) {
    echo "db error:" . mysql_error();
} else {

    $row = mysql_fetch_array($result)

    ?>
    <div class="container">
        <div>
            <label for="title">title: </label>
            <?php echo $row['title']; ?>
        </div>


        <div>
            <?php echo $row['content']; ?>
        </div>


        <div>
            <button onclick="history.back();">back</button>
            <a href="blog_edit.php?id=<?php echo $id;?>">Edit</a>
        </div>

    </div>
<?php
}
?>
</body>
</html>

